import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
import { IsEmail } from 'class-validator'

@Entity()
export class TcUsers {
  @PrimaryGeneratedColumn()
  uid!: number;
  @Column({length:80})
  name!: string;
  @Column('text')
  passwd!: string;
  @IsEmail()
  @Column({length:100})
  email!:string
}

export const userSchema = {
  id: { type: 'number', required: true, example: 1 },
  name: { type: 'string', required: true, example: 'Javier' },
  passwd: { type: 'string', required: true, example: '' },
  email: { type: 'string', required: true, example: 'avileslopez.javier@gmail.com' }
};